package com.example.sms.controller;

import com.example.sms.exception.R;
import com.example.sms.service.AdministratorsService;
import com.example.sms.service.StudentService;
import com.example.sms.service.TeacherService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "管理员端口")
@Slf4j
@RequestMapping("/Administrator")
public class AdministratorController {
    @Autowired
    private AdministratorsService administratorsService;
    @Autowired
    private TeacherService teacherService;
    @Autowired
    private StudentService studentService;
    @Operation(summary = "获取所有学生")
    @GetMapping("ListAllStudent")
    public Object listStudent(){
        log.info("获取所有学生");
        return R.ok(studentService.list());
    }
    @Operation(summary = "获取所有教师")
    @GetMapping("ListAllTeacher")
    public Object listTeacher(){
        log.info("获取所有教师");
        return R.ok(teacherService.list());
    }
}
